package com.train.daily.config;


import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.core.env.ConfigurableEnvironment;

@Slf4j
@SpringBootApplication
@ComponentScan(basePackages = {"com.train.*"})
@MapperScan(basePackages = {"com.train.daily.mapper"})
@EnableAspectJAutoProxy(exposeProxy = true)
public class DailyTrainApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(DailyTrainApplication.class, args);
        ConfigurableEnvironment environment = context.getEnvironment();
        log.info("http://localhost:" + environment.getProperty("server.port") + environment.getProperty("server.servlet.context-path"));
        log.info("启动成功");
    }

}
